<template>
  <!-- 主体 -->
  <div class="subject">
    <header>
      <!-- 头像框 -->
      <div class="head_portrait">
        <van-row justify="space-between">
          <van-col class="col_span1" span="12">
            <van-icon name="chat-o" size="20" color="#fff" />
          </van-col>
          <van-col class="col_span2" span="12">
            <van-icon name="setting-o" size="20" color="#fff" />
          </van-col>
        </van-row>
        <div class="img">
          <img src="../../assets/img/tuxiang.png" alt="" />
        </div>
        <span v-text="username">呜呜呜</span>
      </div>
    </header>
    <main>
      <!-- 索引 -->
      <div class="indexes">
        <van-grid>
          <van-grid-item text="优惠券" @click="coupons">
            <van-icon
              class="iconfont icon-wodeyouhuiquan"
              color="#ff5654"
              class-prefix="icon"
              slot="icon"
            >
            </van-icon>
          </van-grid-item>
          <van-grid-item text="收藏" @click="collection">
            <van-icon
              class="iconfont icon-shoucang2"
              color="#ff5654"
              class-prefix="icon"
              slot="icon"
            >
            </van-icon> </van-grid-item
          ><van-grid-item text="约看" @click="look">
            <van-icon
              class="iconfont icon-yuyuekanfang"
              color="#ff5654"
              class-prefix="icon"
              slot="icon"
            >
            </van-icon> </van-grid-item
          ><van-grid-item text="订单" @click="orders">
            <van-icon
              class="iconfont icon-dingdan"
              color="#ff5654"
              class-prefix="icon"
              slot="icon"
            >
            </van-icon>
          </van-grid-item>
        </van-grid>
        <van-grid>
          <van-grid-item text="私人助理" @click="assistant">
            <van-icon
              class="iconfont icon-24gl-headset"
              color="#ff5654"
              class-prefix="icon"
              slot="icon"
            >
            </van-icon> </van-grid-item
          ><van-grid-item text="微聊" @click="microChat">
            <van-icon
              class="iconfont icon-weiliao1"
              color="#ff5654"
              class-prefix="icon"
              slot="icon"
            >
            </van-icon> </van-grid-item
          ><van-grid-item text="评价" @click="appraise">
            <van-icon
              class="iconfont icon-pingjia"
              color="#ff5654"
              class-prefix="icon"
              slot="icon"
            >
            </van-icon> </van-grid-item
          ><van-grid-item text="投诉建议">
            <van-icon
              class="iconfont icon-tousujianyi1"
              color="#ff5654"
              class-prefix="icon"
              slot="icon"
            >
            </van-icon>
          </van-grid-item>
        </van-grid>
      </div>
      <!-- 小标题 -->
      <div class="subheading">
        <span>宜居管家</span>
        <span>宜居专项服务</span>
      </div>
      <!-- 索引下半部分 -->
      <div class="indexes">
        <van-row gutter="20">
          <van-grid>
            <van-col span="8">
              <van-grid-item text="我的合同" @click="contract">
                <van-icon
                  class="iconfont icon-wodehetong3"
                  color="#ff5654"
                  class-prefix="icon"
                  slot="icon"
                >
                </van-icon>
              </van-grid-item>
            </van-col>
            <van-col span="8">
              <van-grid-item text="转租" @click="sublet">
                <van-icon
                  class="iconfont icon-zhuanzu"
                  color="#ff5654"
                  class-prefix="icon"
                  slot="icon"
                >
                </van-icon>
              </van-grid-item>
            </van-col>
            <van-col span="8">
              <van-grid-item text="退租" @click="rent_withdrawal">
                <van-icon
                  class="iconfont icon-tuizu"
                  color="#ff5654"
                  class-prefix="icon"
                  slot="icon"
                >
                </van-icon>
              </van-grid-item>
            </van-col>
          </van-grid>
        </van-row>
        <van-row gutter="20">
          <van-grid>
            <van-col span="8">
              <van-grid-item text="芝麻信用" @click="credit">
                <van-icon
                  class="iconfont icon-dingdangdaizhimaxinyongshouquan"
                  color="#ff5654"
                  class-prefix="icon"
                  slot="icon"
                >
                </van-icon>
              </van-grid-item>
            </van-col>
            <van-col span="8">
              <van-grid-item text="续租" @click="myLease_renewal">
                <van-icon
                  class="iconfont icon-xuzu"
                  color="#ff5654"
                  class-prefix="icon"
                  slot="icon"
                >
                </van-icon>
              </van-grid-item>
            </van-col>
            <van-col span="8">
              <van-grid-item text="账单" @click="bill">
                <van-icon
                  class="iconfont icon-bill"
                  color="#ff5654"
                  class-prefix="icon"
                  slot="icon"
                >
                </van-icon>
              </van-grid-item>
            </van-col>
          </van-grid>
        </van-row>
      </div>
    </main>
    <!-- 预留尾部 -->
    <Footer></Footer>
  </div>
</template>

<script>
import Footer from "../../components/Footer.vue";
export default {
  data() {
    return {
      username: ""
    };
  },

  methods: {
    //跳转
    coupons() {
      this.$router.push("/coupons");
    },
    collection() {
      this.$router.push("/collection");
    },
    orders() {
      this.$router.push("/orders");
    },
    assistant() {
      this.$router.push("/assistant");
    },
    appraise() {
      this.$router.push("/appraise");
    },
    contract() {
      this.$router.push("/contract");
    },
    sublet() {
      this.$router.push("/sublet");
    },
    rent_withdrawal() {
      this.$router.push("/rent_withdrawal");
    },
    credit() {
      this.$router.push("/credit");
    },
    myLease_renewal() {
      this.$router.push("/myLease_renewal");
    },
    look() {
      this.$router.push("/look");
    },
    bill() {
      this.$router.push("/bill");
    },
    microChat() {
      this.$router.push("/microChat");
    }
  },
  created() {
    this.$store.commit('setNum', 3)
    this.username = window.localStorage.getItem("user_name")
  },
  components: {
    Footer,
  },
};
</script>

<style lang="less" scoped>
.subject {
  height: 100%;
  background-color: #fefefe;
  border: none;
  header {
    width: 100%;

    background-color: #ff5654;
    height: 360px;

    .head_portrait {
      text-align: center;
      margin: 0 auto;
      font-size: 40px;
      .van-row {
        .col_span1 {
          text-align: left;
          margin-top: 40px;
          padding-left: 20px;
        }
        .col_span2 {
          text-align: right;
          margin-top: 50px;
          padding-right: 20px;
        }
      }
      img {
        width: 140px;
        height: 140px;
        border-radius: 50%;
      }
      span {
        color: #fff;
        font-size: 32px;
      }
    }
  }
  main {
    margin-top: 20px;
    padding: 0 40px;
    // 索引
    .indexes {
      background-color: #fff;
      width: 100%;
      margin: 0 auto;
      margin-top: 40px;

      // padding: 0 20px;
      .icon-undefined {
        font-size: 80px;
      }

      /deep/ .van-grid-item__text {
        margin-top: 10px;
        font-size: 30px;
      }
    }
    // 小标题
    .subheading {
      display: flex;
      margin: 20px 0;
      & > span:nth-child(1) {
        font-size: 30px;
        margin-left: 40px;
      }

      & > span:nth-child(2) {
        font-size: 20px;
        margin-left: 20px;
        margin-top: 8px;
      }
    }
    // 索引下半部分
    .indexes {
      width: 100%;
      margin: 0 auto;
      // margin-top: 20px;
      .icon-undefined {
        font-size: 50px;
      }
      .icon-tuizu {
        font-size: 52px;
      }

      /deep/ .van-grid-item__text {
        font-size: 23px;
      }

      .van-hairline--top {
        padding-top: 20px;
      }
    }
  }
  /deep/ .footer {
    border-top: 1px solid red;
    ul {
      text-align: center;
    }
  }
}
footer {
  ul {
    li {
      &:nth-child(2) {
        /deep/ p {
          color: #ff5654;
        }
      }
    }
  }
}
</style>>
